import React from "react";
import "./less/index.less";
import { Switch, Route, Redirect } from "react-router-dom"

import Login from './pages/login/login.jsx'
import Register from './pages/register/register'
import Index from './pages/index/index.jsx'
import List from './pages/list/list.jsx'
import Detail from './pages/detail/detail.jsx'
import Search from './pages/search/search.jsx'
import Coupon from "./pages/coupon/coupon.jsx";

import './App.less';

const App = () => {
  return (
    <div className="page">
      <Switch>
        <Route path="/login" component={Login}></Route>
        <Route path="/register" component={Register}></Route>
        <Route path="/index" component={Index}></Route>
        <Route path="/list" component={List}></Route>
        <Route path="/detail/:id/:type" component={Detail}></Route>
        <Route path="/search" component={Search}></Route>
        <Route path="/coupon" component={Coupon}></Route>

        <Redirect to="/login"></Redirect>
      </Switch>
    </div>
  )
}

export default App;
